package com.diankangwo.dao.impl;

import com.diankangwo.dao.PayManagementDAO;
import com.diankangwo.domain.PayManagement;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * PayManagementDAO的实现类
 * @author xiaoyu
 * 
 */
@Repository
public class PayManagementDAOImpl extends BaseDaoImpl<PayManagement> implements PayManagementDAO {

	/**
	 * 根据订单号查询
	 * @param billNo
	 * @return
	 */
	@Override
	public PayManagement querPayInformation(String billNo) {
		if (billNo != null) {
			PayManagement payManagement = this.findUniqueByProperty("billNo", billNo);
			if (payManagement != null) {
				return payManagement;
			} else
				return null;
		} else
			return null;
	}

	@Override
	public PayManagement queryOrderById(String id) {
		try {
			Integer nid = Integer.parseInt(id);
			PayManagement payManagement = this.find(nid);
			return payManagement;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

	@Override
	public List<PayManagement> findAllPayManagement() {
		// TODO Auto-generated method stub
		return findAll();
	}

}
